INSTALL=@INSTALL@
CC=@CC@
LIBS=@LIBS@
CFLAGS = @CFLAGS@
OBJECTS=nbtscan.o statusq.o range.o list.o
DEFS=@DEFS@
TARGET=@TARGET@

srcdir = @srcdir@

prefix      = @prefix@
exec_prefix = @exec_prefix@
BINDIR      = @bindir@

$(TARGET): $(OBJECTS)
	$(CC) $(CFLAGS) -o $@ $(OBJECTS) $(LIBS)

install:
	$(INSTALL) $(TARGET) $(BINDIR)/$(TARGET)

nbtscan.o: $(srcdir)/nbtscan.c $(srcdir)/statusq.h $(srcdir)/range.h $(srcdir)/list.h
	$(CC) $(CFLAGS) $(DEFS) -c $<

statusq.o: $(srcdir)/statusq.c $(srcdir)/statusq.h
	$(CC) $(CFLAGS) $(DEFS) -c $<

range.o: $(srcdir)/range.c $(srcdir)/range.h
	$(CC) $(CFLAGS) $(DEFS) -c $<

list.o: $(srcdir)/list.c $(srcdir)/list.h
	$(CC) $(CFLAGS) $(DEFS) -c $<

clean:
	-rm $(OBJECTS) $(TARGET)

distclean: clean
	-rm config.cache config.log config.status Makefile
